<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<DomainModel.Entities.Event>>" %>

<%
// this page is used for event home, event search and event tagging page
 %>

<%foreach (var item in Model)
  { %>
<div class="event_item">
    <ul class="event_rate">
        <li class="event_rate_up"><%= Html.ImageLink(ResolveUrl(Settings.WebImagePath + "vote-arrow-up.png"), "Add This Vote", "AddEventRate", "Rate", new { eventID = item.EventID, returnURL = Request.RawUrl }, null, null)%></li>
        <li class="event_rate_no"><span><% =item.RatesList.Count %></span></li>
        <li class="event_rate_down"><%= Html.ImageLink(ResolveUrl(Settings.WebImagePath + "vote-arrow-down.png"), "Remove This Vote", "RemoveEventRate", "Rate", new { eventID = item.EventID, returnURL = Request.RawUrl }, null, null)%></li>
    </ul>
    <ul>
        <li><span class="site_link_03">
            <%= Html.ActionLink(item.Title, "details", "event", new { id = item.EventID, title = item.Title }, new { title = item.Title })%>
        </span></li>
        <li>
            <label>
                Date:</label>
            <%= item.DateEvent.ToString("yyyy-MM-dd HH:mm")%>
        </li>
        <li>
            <label>
                Details:</label>
            <%=(item.Description.Length > 202 ? item.Description.Substring(0, 205): item.Description) + " " + Html.ActionLink("[read more]", "details", "event", new{id = item.EventID, title = item.Title}, new {title = item.Title}) %>
        </li>
        <li>
            <label>
                Location:</label>
            <%= item.Address%>
        </li>
        <li><span class="users_comments">
            <label>
                Attending users:</label>
            <%=item.RSVPUsers.Count %>
        </span><span class="users_comments">
            <label>
                Comments:</label>
            <%=item.CommentsList.Count%>
        </span></li>
        </ul>
       
         <%Html.RenderPartial("../Tag/TagLine", item);%>
         <br class="clear" />
</div>
<%} %>